import {defineStore} from "pinia";

export const useUserStore = defineStore('user', {
		state: () => {
			return {
				uuid: '', // 存储获取公秘钥对的uuid
				publicKey: '', // 存储获取的公钥
				token: '' // 存储登录成功的token
			}
		},
		actions: {
			setUuid(uuid) {
				this.uuid = uuid
			},
			setPublicKey(publicKey) {
				this.publicKey = publicKey
			},
			setToken(token) {
				this.token = token
			}
		},
		persist: {
			enabled: true
		}
	}
)